cmake_minimum_required(VERSION 3.5)

project(mpp_eglimage_opengles_test LANGUAGES CXX)

set(CMAKE_PREFIX_PATH "/home/linaro/MYGIT/qt6_rockchip_binary/Qt6/lib/cmake")
#set(Qt6_DIR "/home/linaro/Qt6/lib/cmake/Qt6")
#set(CMAKE_PREFIX_PATH "/home/linaro/Qt6/lib/cmake")

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 COMPONENTS
    Core
    Widgets
    OpenGL
    OpenGLWidgets
    #WaylandClient
    )

find_package(PkgConfig)
pkg_check_modules(EGL IMPORTED_TARGET egl)
pkg_check_modules(ROCKCHIP_MPP IMPORTED_TARGET rockchip_mpp)
pkg_check_modules(AVUTIL IMPORTED_TARGET libavutil)
pkg_check_modules(AVFORMAT IMPORTED_TARGET libavformat)
pkg_check_modules(AVCODEC IMPORTED_TARGET libavcodec)
pkg_check_modules(DRM IMPORTED_TARGET libdrm)

set(PROJECT_SOURCES
        main.cpp
        myopenglwidget.cpp
        myopenglwidget.h
        my_shader.h
        decoder.h
        decoder.cpp
)

add_executable(mpp_eglimage_opengles_test
        ${PROJECT_SOURCES}
        )

target_link_libraries(mpp_eglimage_opengles_test
    PRIVATE
    Qt::Widgets
    Qt::OpenGL
    Qt::OpenGLWidgets
    #Qt::WaylandClient
    PkgConfig::EGL
    PkgConfig::DRM
    PkgConfig::ROCKCHIP_MPP
    PkgConfig::AVUTIL
    PkgConfig::AVFORMAT
    PkgConfig::AVCODEC
    )
